
import 'package:get/get.dart';
import 'package:psi/routes/app_pages.dart';
import 'package:psi/services/share_preference_service.dart';

import 'splash_state.dart';

class SplashLogic extends GetxController {
  final SplashState state = SplashState();

  @override
  void onReady() {
    // TODO: implement onReady
    super.onReady();
  }

  @override
  void onClose() {
    // TODO: implement onClose
    super.onClose();
  }

  void goToNext() {
    String? token = SharePreferenceService.getToken();
    if (token == null) {
      Get.offNamed(PageNames.login);
    } else {
      Get.offNamed(PageNames.home);
    }
  }

}
